home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Applications / plain-text-13 / PlainText Worksheet next >
Encoding:
Text File  |  1994-10-01  |  18.7 KB  |  382 lines  |  [TEXT/MRPH]

  1. ;----------------------------------------------------------------------------
  2. ;                                 Worksheet
  3. ;
  4. ; Use this window as a scratch pad for keeping notes and as a space for 
  5. ; temporary and intermediate work. Its contents are saved between launches
  6. ; of the PlainText program. If you don’t like the idea of having a work-
  7. ; that is always open, select the “No Worksheet” option in the Edit Menu.
  8. ;
  9. ;                                            Mel Park, Memphis, Tennessee
  10. ;----------------------------------------------------------------------------
  11.  
  12.     This is version 1.3. of PlainText.
  13.     
  14.     You should make a copy of this file and save it somewhere with a different
  15. name. One way of doing this is to select the “Save a Copy” item from the File 
  16. Menu. Name the copy “Original PlainText Worksheet” or some such.
  17.  
  18. File Menu
  19.     This is standard Mac stuff. PlainText will open any text file. Printing is
  20. pretty ordinary. There is no way to change print margins or lines per page.
  21. A short vertical line appears at the top of every text window which indicates 
  22. the recommended right margin. Text wrapped to this width will be centered on 
  23. the printed page. PlainText prints the page number at the bottom of every page.
  24.     
  25.     If you hold the option key down while selecting the Open menu item, then
  26. all files, not just text files, are displayed and can be opened. Files opened 
  27. in this way are read only. You can copy data from them to the clipboard but 
  28. not change them in any way.
  29.  
  30.     The “Save” menu item is only activated when a file has been changed by
  31. adding or removing characters. The term “dirty” is commonly used to describe 
  32. text files in this state. Non-editing changes, such as changing the font or 
  33. adding a mark do not dirty a file. However, all such changes, even scroll 
  34. position and selection range, are always saved to disk when you close a file. 
  35. So, don’t be surprised by disk activity when you close a file
  36. in which you have made no text changes.
  37.  
  38. Edit Menu
  39.     “Shift Right” and “Shift Left” add or remove one tab on each line or, 
  40. when word wrap is on, each paragraph within the selection region. At the 
  41. same time, it converts all space runs to the corresponding number of tabs.
  42. “Align” aligns all subsequent lines to the first line in the selection
  43. region.
  44.  
  45.     The Undo function provides the one level of undo that you expect with a
  46. Macintosh application. “No Worksheet” will close the worksheet window and
  47. set PlainText to not open a worksheet window in the future. It is reversed
  48. by the “Use Worksheet” menu item which becomes an option when there is no
  49. worksheet. The Format dialog of the Edit Menu is where you select fonts and
  50. font size, turn wordwrapping on or off (ON is the default), select tab width, 
  51. and show or not show invisible characters. These settings are remembered for 
  52. each document and retained between launches. (Naturally, this is a Mac.)
  53.  
  54.     The “Format…” menu item calls a dialog for changing text font, text size,
  55. and certain preferences. The “Show Invisibles” check box prints ‘¿’ for all
  56. non-printing characters, ‘Δ’ for tabs, ‘¬’ for carriage returns, and ‘◊’
  57. for spaces. Automatic word wrap can be turned off or on and made to occur
  58. when text exceeds the width of the text’s window or a particular number of
  59. characters (Line Length). This line length parameter is also used for the
  60. “Hard Wrap to Length” item in the Convert Menu. The “Auto Indent” feature
  61. will look at the preceding line, when word wrap is off, or paragraph, when
  62. word wrap is on, and indent each new line to align with it. Clicking the
  63. okay button (or typing the return or enter key) applies those settings to
  64. the front window. Clicking the cancel button (or typing escape or
  65. command-period) cancels the dialog and does not make any changes to the
  66. front window. Clicking on the “All Files” button applies the settings to
  67. the front window and saves them as default settings that will be applied to
  68. all new windows and any foreign file that has not been previously opened by
  69. PlainText, MPW, or Alpha.
  70.  
  71. Find Menu
  72.     “Find…” and “Replace…” are pretty standard and pretty intuitive functions
  73. for text windows. The search string can be a selection expression, that is,
  74. an expression that contains wildcards. Try a search using *menu as the
  75. selection expression. Choose “Find…” and type “*menu” (with or without
  76. quotes) and click the “Selection Expression” radio button. Now click the
  77. Find button (or hit the return key). See how a line containing “menu” has
  78. been found? Command-G repeats the search.
  79.  
  80.     If the selection expression is a number, it is interpreted as a line
  81. number. Try 85 as a selection expression.
  82.  
  83.     This line, the 85th in this window, will be selected.
  84.  
  85.     If you hold down the shift key when you choose any of the Find menu items,
  86. then the search will be in the reverse direction. This is handiest when
  87. used in conjunction with the keyboard equivalents command-H and command-G.
  88.  
  89.     “Cut Lines Containing…” and “Copy Lines Containing…” allow you to cut or 
  90. copy all lines, or paragraphs if word wrap is on, to the clipboard.
  91.  
  92. Mark Menu
  93.     Marks are like bookmarks that you can place in a text file so that you 
  94. can recall previous selections. When you select a mark from the Mark Menu, 
  95. the text corresponding to that mark is selected and the window scrolls to 
  96. show it. You can add new marks with the Mark menu item and remove them with
  97. Unmark. You can alphabetize the order in which marks are displayed in the
  98. Mark Menu by selecting the Alphabetize menu item. Selecting it again restores 
  99. the original order. Look at the Marks that I have made for this file by 
  100. opening the Marks Menu.
  101.  
  102. Window Menu
  103.     Stack and Tile Windows resize the windows in either a stack or tiled so
  104. that each window is visible on the screen. The remaining menu items are a 
  105. catalog of open windows. The menu item for the front window is checked. The 
  106. target window is indicated by the bullet symbol (•). Windows whose changes 
  107. have not yet been saved to disk are underlined.
  108.  
  109. Convert Menu
  110.     If you spot bugs in them, be sure to let me know. This set of functions,
  111. by the way, was selected from those I find myself using many times a day in
  112. Vantage, the desk accessory editor I have used for years. The big, full-
  113. featured editors, like Pete Keleher’s Alpha and BBEdit, by Rich Siegel, have 
  114. these features, plus many more, as well. Strip Linefeeds is the way to
  115. convert an MS/DOS text file to the Mac convention. Strip Controls removes
  116. all characters with an Ascii code of 31 or less, except carriage returns
  117. and tabs. Form Paragraphs and Straight to Curly Quotes gets it ready for
  118. pasting into a word processor. Hard Wrap to Window and Curly to Straight
  119. quotes reverses those steps, as when you want to prepare text for e-mail.
  120. Both Hard Wrap functions insert hard carriage returns at line ends, where a
  121. line end is either defined by the size of the window (Hard Wrap to Window)
  122. of the line length parameter set in the Format Dialog (Hard Wrap to
  123. Length).
  124.  
  125.     Besides being fast and able to handle even very large files, PlainText has
  126. these built-in features:
  127.  
  128.     1.    Double-clicking selects a whole word. Note that double-clicking
  129.         the space after a word selects the preceeding word and the space.
  130.         This is a bug that is close enough to being a feature that I am 
  131.         not fixing it.
  132.     2.    Triple-clicking selects a whole line.
  133.     3.    Double clicking on or just before a bracket or parenthesis (i.e. 
  134.         “[”, “{”, etc.) causes all the text between the bracket or 
  135.         parenthesis and its matching bracket or parenthesis to become 
  136.         selected.
  137.     4.    Cutting, pasting, and undoing are fully implemented.
  138.     5.    The arrow keys work to move the insertion point or selection (hold
  139.         the shift key down) in the expected ways.
  140.     6.    Command-option-uparrow moves the insertion point to the top of the
  141.         file. Command-option-downarrow does the opposite. Holding the shift
  142.         key down while doing either of these extends the selection to either
  143.         the top or bottom of the document.
  144.     7.    Command-right arrow moves the insertion point to the end of the 
  145.         current line. Option-right arrow moves the cursor by words. The left
  146.         arrow combinations work in the same way, of course, and holding the
  147.         shift key down with any of these combinations extends the selection.
  148.         This is the standard Macintosh use of the arrow keys.
  149.     8.    It is a command-line interpreter in its own right. Simply type a 
  150.         command that PlainText understands and then hit the enter (not
  151.         return) key. This will work in any text window.
  152.  
  153.         The following commands can be executed from any text window: 
  154.         ls (same as dir in DOS), cd (change directory), open, target,
  155.         find, line. Open opens the named file and makes it the front window.
  156.         File is similar except the window is made the target window (second
  157.         from front). “line n” selects selects the nth line of the target
  158.         window (n is a number. “Find exp” searchs the target window for the
  159.         string “exp.” Wildcards can be used with the find and ls commands,
  160.         just as you would expect in DOS.
  161.  
  162.         In summary, hitting the enter key causes the current line or current 
  163.         selection, whichever is smaller, to be interpreted as a command line.
  164.  
  165.         Commands implemented:
  166.  
  167.             cd            Change default directory (folder). Note, the Mac 
  168.                         file system uses the colon to designate the present 
  169.                         or higher folders. Thus “cd ::” changes the default
  170.                         directory one level up.
  171.             chcre        Change a file’s creator. For example, 
  172.                         chcre ‘MRPH’ ‘Current File’ makes PlainText the
  173.                         creator of the file named ‘Current File.’
  174.             chtyp        Change the file type of a file, using the same
  175.                         syntax (chtyp type filename) as chcre.
  176.             file        Open a file and make it the target
  177.             find ss        Find a string in the target window
  178.             ls            List a directory’s contents
  179.             ls -l        Give a full listing of a directory’s contents
  180.             line nn        Select line nn in the target window
  181.             open ff        Open a file
  182.             stats        Prints the statistics of the target window
  183.  
  184. Target Window
  185.     Note that the “line” and “find” comands operate on the TARGET window. The
  186. target window is the window behind the front-most window.
  187.  
  188. Large Files
  189.     PlainText must load its text files entirely into memory. If you get an
  190. out-of-memory error message when trying to open a very large file, just
  191. increase the partition (in the Finder’s Get-Info box for PlainText) to be
  192. larger than the file being opened. In System 7, turn on virtual memory if
  193. necessary.
  194.  
  195. Bug Reports
  196.  
  197.     Send comments and complaints to:
  198.  
  199.         Mel Park
  200.         Associate Professor
  201.         Department of Anatomy and Neurobiology
  202.         University of Tennessee
  203.         855 Monroe Avenue
  204.         Memphis, TN 38163
  205.         (901) 448-5984
  206.         mpark@utmem1.utmem.edu
  207.  
  208. PlainText is free.
  209.  
  210. Revision History
  211.  
  212. 0.4:     Fixed Standard File System 6 incompatibilities.
  213. 0.5:     Wordwrap is now the default.
  214.          Horizontal scroll bar occurs when it should.
  215.          Wordwrap to window correctly updates window.
  216.          Fixed Out of Memory problem with add linefeeds.
  217. 0.6:     Worksheet is an option.
  218.          Added font scaling and changing.
  219.          Open, file, and line commands now work in System 6.
  220.          All text moved to resources so that PlainText can now be
  221.            internationalized.
  222. 0.7:     Added Align, Shift Left, and Shift Right functions.
  223.          Fixed bug in which a strings just past the cursor were not
  224.            found in a forward search.
  225.          Open with option key down shows all files, not just text
  226.            files.
  227. 0.8:     SaveAFile stores resources properly and no longer causes
  228.            crashes.
  229.          The Standard File dialog is no longer displayed twice for new 
  230.            files.
  231.          Typing no longer overwrites the horizontal scroll bar.
  232.          Fixed some minor annoyances in v. 0.8a, like new windows coming
  233.            up with the wrong horizonal scroll bar and the cursor not being
  234.            erased when a window is deselected.
  235. 0.9:     There were bad crashes after some combinations of “Returns to
  236.            Linefeeds” and Saves or Closes, due to an old bug in the Mac
  237.            Menu Manager. Fixed now.
  238.          Similar bug was causing the Edit Menu to disappear when “No 
  239.            Worksheet” was selected.
  240.          Worksheet and non-worksheet windows open with or without a 
  241.            Go-Away Box as they should.
  242.          Added partial support for extended keyboard (Undo, cut, paste,
  243.            copy, page up, page down).
  244.          In System 7, opening from the finder directs Standard File package
  245.            to proper directory.
  246.          Horizonal arrow keys work properly except anchor point not yet
  247.            implemented.
  248. 0.91:     Extended keyboard fully implemented.
  249.          Fixed crashes due to Menu Manager bug.
  250. 1.0:     Added entab and detab functions.
  251.          Added word wrap to line lengths
  252.          Added autoindent
  253.          These last required additions to Format dialog.
  254.          Horizontal arrow keys now have an anchor point.
  255.          Word wrap to window is default for foreign text files as well
  256.            as new ones.
  257.          Command-arrow key functions now update the scroll bars.
  258.          Fixed conditions that would could cause a window to forget 
  259.            that it was dirty, with subsequent loss of most-recently 
  260.            typed data.
  261.          Text inserted at end of a line now drawn properly.
  262.          Errors in calculating buffer length in this last condition
  263.            also fixed.
  264.          Blinking cursor no longer interferes with text.
  265.          Show Invisibles with proportional fonts now works properly.
  266.          Go-Away box appears when it should in all conditions. 
  267.          Fixed System 6 bugs--can now open from finder.
  268.          Hiliting of selection range is now always in the right place.
  269.          Inserting text beginning with a carriage return used to foul up
  270.            the line starts array. This could cause a crash.
  271.          Crashes related to marks and selections beyond the text buffer
  272.            fixed.
  273. 1.1:     Fixed crashes due to errors in writing resources.
  274.          This means that resource forks are no longer corrupted.
  275.          Word wrap to length now works for newly opened documents.
  276.          Marks stopped working in v.1.0. Fixed.
  277.          Text now updated after Tile or Stack Windows.
  278.           Scroll bars now properly hilited after Tile and Stack Windows.
  279. 1.2:     Format and date in ls -l command now correct.
  280.          Searches for Entire Word now work.
  281.          All Clipboard window deficiencies fixed, i.e. it is now updated
  282.            as it should be after cuts and copies, Menus are properly
  283.            updated when this is the selected window, and the blinking
  284.            cursor is disabled.
  285.          In large files, the blinking cursor would be displayed as a long
  286.            vertical line when the window was scrolled more than 32K pixels
  287.            beyond the insertion point. Fixed.
  288.          Line length default really set to 75. This means that the “Word 
  289.            Wrap to Length” menu item works from the very beginning.
  290.          Implemented “Revert to Saved.”
  291.          Fixed scrolling error when large blocks of text deleted.
  292. 1.2a:     When word wrap is on, Autoindent indents paragraphs, not lines.
  293.          PlainText will now open documents on locked volumes.
  294.          Saving now always flushes files to disk with every Save, even if 
  295.            it is a sleeping PowerBook disk.
  296.          Tile and Stack Windows now work properly when there is no 
  297.            worksheet.
  298.          No longer asks to save a saved new document when quitting.
  299.          Short lines nolonger pirate* the up and down arrow key cursor
  300.            movements.
  301.          Shift and align improved to work on word-wrapped paragraphs.
  302. 1.2b:     Marks now aligned after pasting text.
  303.          Will now print beyond 32K of text.
  304. 1.2c:     Marks now updated after large selections of text deleted.
  305.          Will now print invisible characters and tabs.
  306. 1.2d:     Added page numbers to printed page.
  307. 1.2.1:     First non-beta release to public servers, i.e. Info-Mac.
  308.           Restored “File open in another application” alert.
  309.           In word wrap, adding or deleting text that caused rewrapping of
  310.             paragraphs with more than 32 lines used to blank part of the 
  311.             window above the changed text. Fixed.
  312. 1.2.2     “Tile Windows” formally tiled the Worksheet window and not the 
  313.            last text window. It now excludes the Worksheet from tiling.
  314.          Added support for a Preferences file for storing defaults.
  315.          Added the stats command-line option.
  316.          Added a four-pixel tick mark at the top of each window to indicate
  317.            the printed page width, minus 1” right and left margins.
  318.          Tabs now aligned when typing in the middle of a line.
  319. 1.2.3     1.2.2 introduced a bug that caused characters typed at the beginning
  320.            of an empty window to either not be draw are drawn in the wrong
  321.            position.
  322. 1.2.4     There was still misalignment when tabs were typed. Fixed.
  323.          Added chtyp and chcre commands.
  324.          The “Find Selection” menu item now activated for locked windows.
  325.          Added the “Strip Controls” menu item.
  326. 1.2.5     Fixed curor misplacement when typing returns at the end of a text 
  327.            file with AutoIndent on.
  328.          Files without resource forks would not open. I think this bug also
  329.            caused drag-and-drop to fail for these files.
  330.          Fixed the sometimes garbled text in the confirmation dialogs.
  331.          Cut and paste now works in the Find and Replace dialogs.
  332.          “Revert to Saved” previously caused a scrolling error.
  333. 1.2.6     Deleting an entire file would not delete the file’s marks. Fixed.
  334.          Cursor initialized with each activate event.
  335. 1.2.7     “Save As…” and “Save A Copy…” will now replace an existing file in
  336.            the proper way.
  337.          Added “P” as the keyboard equivalent for printing.
  338. 1.2.8     Zooming is now to the best size for a text window and not full screen.
  339.          All other Apple guidelines for zooming now conformed to.
  340.          Scroll bars no longer drawn twice in zooming.
  341.          Stats command now works at all times.
  342.          New window opened to ideal size.
  343. 1.2.9     Fixed zooming bug introduced in 1.2.8 that caused crashes in System 6.
  344.          Several obscure coding errors turned up in using the MetroWerks
  345.            compiler. These were probably never seen by users.
  346. 1.2.9a     Further fix of zooming bug. (Thanks to Bruce Craven and Joel Martin.)
  347. 1.3         Replace now doesn’t insert an extra character.
  348.          Dialog for find and replace now modeless (thanks to David Wright).
  349.          Strip Controls no longer deletes accented characters.
  350.           The line length parameter is saved.
  351.           Tabs to Spaces used to skip every other sequential tab.
  352.           Added “Cut/Copy Lines Containing” dialog.
  353.            
  354. Known bugs
  355.      Marks are not properly updated after entab and detab functions.
  356.      Marks sometimes not updated properly during normal editing. (Probably 
  357.        fixed in v.1.2b.)
  358.      Unbroken text (i.e. containing no spaces) is wrapped to window width.
  359.      If no printer is selected, new windows do not appear on the screen.
  360.      Windows sometimes do not appear on the screen in other conditions,
  361.        perhaps related to memory overflow.
  362.      Vertical scroll bars are not shown if the number of lines in a file
  363.        exceeds 32K.
  364.      Hard Wrap to Length will incorrectly wrap some lines when word wrapping
  365.        to length is turned on. (Probably fixed in v.1.3.)
  366.  
  367. Features to be added:
  368.      Searching for carriage returns and other special characters.
  369.      Compile in PowerPC native mode.
  370.      Floating window for display of text stats.
  371.      Saving a default directory
  372.  
  373. Thanks to  Bruce Craven, Doug Dyment, Scott Gruby, Ralph Muha, Florin Neumann,
  374. Robert J. Rockefeller, Michael O’Henly, Russel N. Owen, Ted Ripberger, Rich 
  375. Siegel, David Wright, and particularly to Rich Scarlet for their many helpful
  376. comments.
  377.  
  378. ------------
  379.  
  380. * Geo-speak. A stream is pirated when its flow is diverted into a 
  381.   neighboring water course.
  382.